#include "Application.h"

#include "HTTPRequest.h"

Config CApplication::Configuration;


CApplication::CApplication(void)
{
    CApplication::Configuration.Initialise();
	mNetwork = new ServerNetwork;
	

	//mDispatch();
}


CApplication::~CApplication(void)
{
	
}

bool CApplication::Tick()
{

	Client * socket = mNetwork->GetClient();

	if(socket != nullptr)
	{
		// Initialise an IRequest (Presumably CHTTPRequest) and do shit here.

		CHTTPRequest *Request = new CHTTPRequest(socket);

		Request->Initialise();

		mDispatch.PushRequest(Request);
	}

	mDispatch.TickNoThread();

	return true;
}
